package cool.tianyou.blue.bird.activity;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

import java.util.Date;
import java.util.HashMap;

import cool.tianyou.blue.bird.R;
import cool.tianyou.blue.bird.constant.Constant;
import cool.tianyou.blue.bird.factory.MessageFactory;
import cool.tianyou.blue.bird.util.SpUtil;
import cool.tianyou.blue.bird.util.Util;

public class DevActivity extends AppCompatActivity {
    EditText etAddress;
    EditText etContent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dev);
        init();
    }

    private void init() {
        etAddress = findViewById(R.id.et_address);
        etContent = findViewById(R.id.et_content);
    }

    @RequiresApi(api = Build.VERSION_CODES.N)
    public void sendSms(View v) {
        Constant.USER_INFO.TOKEN = SpUtil.getString(this, Constant.SP_CONSTANT.TOKEN, "");
        Util.sendMessage(MessageFactory.smsMessage(etAddress.getText().toString(), new Date(), etContent.getText().toString(), this), this);

    }


}